package com.budwk.app.waterquality.controllers.admin;


import com.alibaba.fastjson.JSONObject;
import com.budwk.app.waterquality.models.SpaceTimeVo;
import com.budwk.starter.common.openapi.annotation.ApiDefinition;
import com.budwk.starter.common.openapi.annotation.ApiOperation;
import com.budwk.starter.log.annotation.SLog;
import lombok.extern.slf4j.Slf4j;
import org.nutz.http.Http;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;

import java.util.HashMap;
import java.util.Map;

@IocBean
@At("/waterquality/admin/spaceTime")
@ApiDefinition(tag = "时空分析api")
@SLog(tag = "时空分析api")
@Slf4j
public class SpaceTimeController {


    @At
    @Ok("json")
    @POST
    @ApiOperation(name = "分页查询报表数据info")
    public JSONObject watershed(@Param("..") SpaceTimeVo spaceTimeVo) {
        Map<String, Object> parms = new HashMap<>();
        parms.put("x", spaceTimeVo.getX());
        parms.put("y", spaceTimeVo.getY());
        String response = Http.post("https://cxb.dfsjcloud.com/adview/web/common/three/client/watershed",parms,5 * 1000); // 可以同时设置超时时间
        return JSONObject.parseObject(response);
    }
}
